﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using static System.Net.WebRequestMethods;
using VIID;

namespace VIID.Client
{
    public partial class Client
    {
        /// <summary>
        /// 新增订阅
        /// </summary>
        public static void Subscribes()
        {
            SubscribeList subscribeObjects = new SubscribeList
            {
                SubscribeObject = new Subscribe[]
                {
                    new Subscribe()
                    {
                    // 订阅 id = 行政区划码 + ？ + 时间戳（14位） +  5位数字
                    SubscribeID = "4000000000000020230406165810xxxxx",
                    Title = "人脸数据订阅",
                    SubscribeDetail = "12", // 订阅类别	12 人脸数据
                    ResourceURI = "40000000000000000000",   // 订阅资源路径（下级平台编码）
                    ApplicantName = "申请人",
                    ApplicantOrg = "申请单位",
                    BeginTime =DateTime.Now,
                    EndTime = DateTime.Parse("2099-12-31 23:55:59"),
                    // 订阅方（上级平台）接收通知的地址
                    ReceiveAddr = "http://xx.xx.xx.xx:xx/VIID/SubscribeNotifications",
                    // 信息上报间隔时间
                    ReportInterval = 3,
                    Reason = "原因",
                    OperateType = 0,    // 操作类型
                    SubscribeStatus = 0,    // SubscribeStatus
                    ResourceClass = 4,      // 订阅资源类别

                    /** 
                     * 返回结果图片约定： 
                     * -1 不传图片；01 车辆大图；02 车牌彩色小图；11 人脸图；14 场景图
                     * 对应数据推送时的SubImageInfo对象中的type字段
                     */
                    ResultImageDeclare = "14",
                    ResultFeatureDeclare = 1	// 返回结果特征值约定
                }
                      }
            };




        }
        public static void Chanel()
        {
            var SubscribeObject = new Subscribe()
            {
                SubscribeID = "4000000000000020230406165810xxxxx",
                Title = "人脸数据订阅",
                SubscribeDetail = "12",
                ResourceURI = "40000000000000",
                ApplicantName = "申请人",
                ApplicantOrg = "申请单位",
                BeginTime = DateTime.Parse("20230330145245"),
                EndTime = DateTime.Parse("20991231235959"),
                ReceiveAddr = "http://xx.xx.xx.xx:xx/VIID/SubscribeNotifications",
                ReportInterval = 3,
                Reason = "采集人脸图片信息",
                OperateType = 1,
                SubscribeStatus = 1,
                ResourceClass = 4,
                ResultImageDeclare = "14",
                ResultFeatureDeclare = 1,
                // 取消订阅参数
                CancelTime = DateTime.Now,
                CancelReason = "444",
                SubscribeCancelOrg = "取消单位",
                SubscribeCancelPerson = "取消人"
            };
        }
        
    }
}
